<!DOCTYPE html>
<html><head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">  
	    <title>LEECTF-RESET PASSWORD</title>
    
	    <link href="reset_passwords_files/css.css" rel="stylesheet">
	    <link href="reset_passwords_files/bootstrap.css" rel="stylesheet">
	    <link href="reset_passwords_files/font-awesome.css" rel="stylesheet">
	    <link href="reset_passwords_files/templatemo-style.css" rel="stylesheet">
        <link href="reset_passwords_files/style.css" rel="stylesheet">
		<link rel="stylesheet" href="reset_passwords_files/normalize.css">
		
	</head>
	
	
	<body style="overflow:-Scroll;overflow-y:hidden;">
		<section id="slider">
			<div class="single-slider">
				<div id="particles-js">
					
				<canvas class="particles-js-canvas-el" style="width: 100%; height: 100%;"></canvas></div>
				<!--登陆窗口-->
				<div class="templatemo-content-widget templatemo-login-widget white-gray-bg">
	       			<form action="php/reset_passwords.php" method="post" onsubmit="return alter()" class="templatemo-login-form">
						<center>
	          				<h1 style="font-family: 'Comic Sans MS', cursive; font-size:28pt">RESET&nbsp;PASSWORD</h1>
						</center>
						<!--studentID输入窗-->
	        			<div class="form-group">
	        				<div class="input-group">
		        				<div class="input-group-addon"><i class="fa fa-user fa-fw"></i>
								</div>	        		
		              			<input name="username" id="username" class="form-control" placeholder="User Name" type="text"><br>           
		          			</div>	
	        			</div>
						<!--Email输入窗--> 
						<div class="form-group">
	        				<div class="input-group">
		        				<div class="input-group-addon">
									<i class="fa fa-envelope fa-fw"></i>
								</div>	        		
		              			<input class="form-control" id="email" name="email" placeholder="Student@bupt.edu.cn" type="email">           
		          			</div>	
	        			</div>
						<!--password输入窗-->
	        			<div class="form-group">
	        				<div class="input-group">
		        				<div class="input-group-addon"><i class="fa fa-key fa-fw"></i>
								</div>	        		
		              			<input class="form-control" placeholder="New Password" name="newpassword" id="newpassword" type="password"><br>           
		          			</div>	
	        			</div>
						<!--spassword确认窗--> 
						<div class="form-group">
	        				<div class="input-group">
		        				<div class="input-group-addon"><i class="fa fa-warning fa-fw"></i>
								</div>	        		
		              			<input class="form-control" placeholder="Confirm Password" type="password" name="assertpassword" id="assertpassword">           
		          			</div>	
						</div>
						<!--验证码-->
						<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon"><i class="fa fa-share fa-fw"></i>
									</div>	        		
									  <input name="authcode" id="authcode" class="form-control" placeholder="input the authcode" type="text">           
								</div><br>
								<p><img src="php/authcode.php" onClick="this.src='php/authcode.php?nocache='+Math.random()" style="cursor:hand" alt="点击换一张"/> click the picture to get another one </p>
						</div>
						<!--重置按钮-->
						<div class="form-group">
							<button type="submit" value="修改密码" onclick="return alter()" class="templatemo-blue-button width-100">reset</button>
						</div>
	        		</form>
	   	 		</div>
			</div>
		</section>
		
		
				<!--js设置背景-->
		<script src="reset_passwords_files/particles.js"></script>
		<script src="reset_passwords_files/particle-code.js"></script>

 
 	<script type="text/javascript">
		function alter() {
			
			var username=document.getElementById("username").value;
			var email=document.getElementById("email").value;
			var newpassword=document.getElementById("newpassword").value;
			var assertpassword=document.getElementById("assertpassword").value;
			var regex=/^[/s]+$/;
			if(regex.test(username)||username.length==0){
				alert("用户名格式不对");
				return false;
			}
			if(regex.test(email)||email.length==0){
				alert("邮箱格式不对");
				return false;
			}
			if(regex.test(newpassword)||newpassword.length==0) {
				alert("新密码格式不对");
				return false;
			}
			if (assertpassword != newpassword||assertpassword==0) {
				alert("两次密码输入不一致");
				return false;
			}
			return true;
 
		}
	</script> 
	
	
</body></html>